#define textInput(label,name,instanceName)
    <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>#(label??"")：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" value="#(generateExpressStr(instanceName,name))"
                   maxlength="50" placeholder="请输入#(label??'')..." id="#(name??'')" name="#(instanceName??'').#(name??'')">
        </div>
    </div>
#end

#define adminFormValidate(ID,instanceName,columns,action)
    $("#(ID)").validate({
        rules:{
    #for(column:columns)
        #if( column.columnName!='id')
            #if(!for.last)
                "#(instanceName).#(column.columnName)":{
                    required:true
                },
            #else
                "#(instanceName).#(column.columnName)":{
                    required:true
                }
            #end
        #end
    #end
        },
        messages:{

    #for(column:columns)
        #if( column.columnName!='id')
            #if(!for.last && column.columnName!='id' )
                "#(instanceName).#(column.columnName)":{
                required:"请输入#(column.columnRemark)..."
                },
            #else
                "#(instanceName).#(column.columnName)":{
                required:"请输入#(column.columnRemark)..."
                }
            #end
        #end
    #end
        },
        onkeyup:false,
        focusCleanup:true,
        success:"valid",
        submitHandler:function(form){
        var config = {
        "url":"#(contextPath)/admin/#(instanceName??'')/#(action??'')",
        data:$("#(ID)").serialize(),
        "method":"POST"
        };
        var backendTool = new BackendTool(config);
        backendTool.ajaxRequest();
        }
    });
#end


#define adminListTable(ID,instanceName,columns)
    $(function(){
        var _table;
        _table =$("#(ID)").DataTable( {
            aLengthMenu:[10,20,50],
            "processing": true,
            "serverSide": true,
            "bLengthChange": false,
            "bSort":false,
            searching: false,//屏蔽datatales的查询框
            "pagingType":   "full_numbers",
            "ajax":{
                "url": "#(contextPath)/admin/#(instanceName??'')/listAll",
                "type": "post",
                "data": function (params) {
                    #for(column:columns)
                        params["#(column.columnName)"]=$("#(generateJqueryIdStr(column.columnName))").val();
                    #end
                }
            },
            "columns": [
                #for(column:columns)
                    { "data": "#(column.columnName)" },
                #end
                { "data": function(data){
                    var edit="<a href='javascript:;' onclick='edit("+data.id+")'>编辑</a>"+"|";
                    var del="<a href='javascript:;' onclick='del("+data.id+")'>删除</a>";
                    return edit+del;
                }
                }
            ]
        } );
        $("#searchBtn").click(function(){
            _table.ajax.reload();
        });
});
    /*编辑*/
    function edit(id){
        var title="编辑";
        var url="#^(contextPath)/admin/#(instanceName??'')/queryById?id="+id;
        var w="";
        var h=510;
        layer_show(title,url,w,h);
    }
    /*添加*/
    function add(){
        var title="添加";
        var url="#^(contextPath)/admin/#(instanceName??'')/add/";
        var w="";
        var h=510;
        layer_show(title,url,w,h);
    }

    /*删除*/
    function del(id){
        var config = {
        "url":"#^(contextPath)/admin/#(instanceName??'')/deleteById?id="+id,
        data:{}
        };
        var backendTool = new BackendTool(config);
        backendTool.ajaxRequest();
    }
#end


#define breadcrumb(items)
    <nav class="breadcrumb">
        <i class="Hui-iconfont">&#xe67f;</i> 首页
        #for(i : items)
            <span class="c-gray en">&gt;</span>#(i)
        #end
        <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
            <i class="Hui-iconfont">&#xe68f;</i></a>
    </nav>
#end